Byte4IO
 
Component Byte4IO
General Four-Bytes Input/Output
Component Level: High
Typical Usage:
(Examples of a typical usage of the component in user code. For more information please see the page Component Code Typical Usage.)

Required component name is "Bt41".
Some examples of typical usage of this component are the following:

(1)
The direction of the component is set to input.

 MAIN.C

void main(void)
{
  /* Wait until "10101010" is on the port 0,
     "01010101" is on the port 1, 
     "00010001" is on the port 2 and
     "11111111" is on the port 3 */
  while( Bt41_GetVal() != 0xFF1155AA );
    :
}

(2)
The direction of the component is set to output.

 MAIN.C

void main(void)
{
  Bt41_PutVal(0xFF1155AA);
  /* "10101010" is on the port 0,
     "01010101" is on the port 1, 
     "00010001" is on the port 2 and
     "11111111" is on the port 3 */
  
  for (;;) {
  /* Invert output level of eighth pin on the port 3 */
    Bt41_NegBit(31);
  }
}

(3)
The direction of the component is set to input/output.

 MAIN.C

void main(void)
{
  Bt41_SetDir(FALSE);  // Set input mode

  /* Wait until "0xFFFFFFFF" is on the ports */
  while( Bt41_GetVal() != 0xFFFFFFFF );
  
  Bt41_SetDir(TRUE);   // Set output mode

  Bt41_PutVal(0);      // Set "0x00000000" on the ports
}